<template>
  <div class="card">
    <div class="app-flex-bet card-top">
      <div class="card-text">{{ $t("order.cardTypeName") }}</div>
      <div class="card-right" style="color: #e93434" v-if="props.type == 1">
        {{ $t("order.orderSuccess") }}
      </div>

      <div
        class="card-right"
        style="color: #73d967"
        v-else-if="props.type == 2"
      >
        {{ $t("order.orderFail") }}
      </div>
      <div
        class="card-right"
        style="color: #515052"
        v-else-if="props.type == 0"
      >
        {{ $t("order.orderDoing") }}
      </div>
    </div>
    <div class="card-body">
      <img :src="item.cardIconUrl" alt="" class="img" />
      <div class="right">
        <div class="msg">
          <div class="mag-name">{{ item.cardDes }}</div>
          <div class="msg-card">Code:{{ item.cardCode }}</div>
          <div class="msg-date">{{ item.addTime }}</div>
        </div>
        <div class="right-money">
          <span>{{ $t("moneyIcon") }}{{ item.totalPrice }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const props = defineProps({
  type: {
    type: Number,
    default: 1,
  }, // 成功，失败，处理中
  item: Object,
  message: Number,
});
</script>

<style lang="less">
.card {
  margin: 10px 15px 0;
  background: #fff;
  border-radius: 10px;
  padding: 10px 15px 20px;
  &-top {
    padding-bottom: 10px;
    line-height: 1;
    border-bottom: 1px solid #f6f6f6;
  }
  &-text {
    font-size: 11px;
    color: #999999;
  }
  &-right {
    font-size: 12px;
  }
  .card-body {
    display: flex;
    margin-top: 15px;
    justify-content: space-between;
    .img {
      width: 70px;
      height: 70px;
    }
    .right {
      // display: flex;
      flex: 1;
      margin-left: 20px;
      .msg {
        &-name {
          font-size: 14px;
          font-family: PingFang SC;
          font-weight: bold;
          color: #333333;
          line-height: 14px;
        }
        &-card {
          min-width: 145px;
          height: 16px;
          padding: 4px 8px;
          background: #f6f6f6;
          border-radius: 8px;
          font-size: 10px;
          font-family: PingFang SC;
          font-weight: 500;
          color: #666666;
          line-height: 16px;
          margin-top: 5px;
          margin-bottom: 5px;
        }
        &-date {
          font-size: 11px;
          font-family: PingFang SC;
          font-weight: 400;
          color: #999999;
          line-height: 12px;
        }
      }
      &-money {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-end;

        span {
          font-size: 18px;
          font-family: PingFang SC;
          font-weight: bold;
          color: #ed008c;
          line-height: 18px;
        }
      }
    }
  }
}
</style>
